var  mimeTypeArr = {
	img:['image/png', 'image/jpeg' , 'image/jpeg', "image/gif" ],
	excel:[ "application/vnd.ms-excel" , "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" ],
	ppt:['application/vnd.ms-powerpoint', 'application/vnd.openxmlformats-officedocument.presentationml.presentation'],
	word:["application/msword", 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'],
	text:[ "text/plain" ],
	pdf:[ "application/pdf"],
	ZIPRAR:[ "application/x-zip-compressed" ],
	video:[],
	audio:[],
	other:['*/*'],
}

/**
 *  
 */
const  mimeTypejup = (mimeType) => {
    let type = "";
	if(mimeTypeArr.img.indexOf(mimeType)>-1){
		return type  =  'img'
	}else if(mimeTypeArr.excel.indexOf(mimeType)>-1){
		return type  =  'excel'
	}else if(mimeTypeArr.ppt.indexOf(mimeType)>-1){
		return type  =  'ppt'
	}else if(mimeTypeArr.word.indexOf(mimeType)>-1){
		return type  =  'word'
	}else if(mimeTypeArr.text.indexOf(mimeType)>-1){
		return type  =  'text'
	}else if(mimeTypeArr.ZIPRAR.indexOf(mimeType)>-1){
		return type  =  'ZIPRAR'
	}else if(mimeTypeArr.video.indexOf(mimeType)>-1){
		return type  =  'video'
	}else if(mimeTypeArr.audio.indexOf(mimeType)>-1){
		return type  =  'audio'
	}else if(mimeTypeArr.other.indexOf(mimeType)>-1){
		return type  =  'other'
	}
}

module.exports = {
    mimeTypejup
}
